<script>
    var arr = new Array('totalnum', 'readynum', 'completenum', 'canclenum'); 
    function chgValue(node) {
        node.parentNode.parentNode.style.background = 'yellow';
        new Ajax.Request('courseOrders_proc.php', {
                method: 'post',
                encoding: 'UTF-8',
                parameters: {
                    datano: node.parentNode.parentNode.getAttribute('datano'),
                    type: node.tagName,
                    value: node.value
                },
                onSuccess: function(transport) {
                    var tmp = transport.responseText.evalJSON();
                    if(tmp.result) {
                        node.parentNode.parentNode.style.background = '#fff';
                        if(node.tagName == "SELECT") {
                            var beforeType = parseInt(node.getAttribute('typevalue')); 
                            var afterType = parseInt(node.value); 
                            var beforeNode = document.getElementById(arr[beforeType]);
                            var beforeValue = parseInt(beforeNode.innerHTML);
                            var afterNode = document.getElementById(arr[afterType]);
                            var afterValue = parseInt(afterNode.innerHTML);
                            node.setAttribute("typevalue", node.value);
                            beforeNode.innerHTML = beforeValue-1;  
                            afterNode.innerHTML = afterValue+1;  
                        }
                    }
                }
        }); 
    }
</script>
<table width="100%" cellspacing="0" cellpadding="0" border="0" background="images/sub_bg.gif">
<tbody><tr>
<td><table width="823" cellspacing="0" cellpadding="0" border="0">
<tbody><tr>
<td background="images/sub_bg_title.gif"><img width="271" height="70" border="0" src="images/sub_title_product.gif"/></td>
</tr>
</tbody></table></td>
</tr>
<tr>
<td valign="top" height="40"><table width="823" cellspacing="0" cellpadding="0" border="0">
<tbody><tr>
<td><img width="1" height="1" src="images/1blank.gif"/></td>
<td width="89" bgcolor="#000000" align="right"><a href="./courseOrders.php"><img width="75" height="24" border="0" src="images/sub_product_01.gif"/></a></td>
<td width="26" bgcolor="#000000"><img width="26" height="24" src="images/sub_menu_line.gif"/></td>
<td width="89" bgcolor="#000000"><a href="./bookOrders.php"><img width="75" height="24" border="0" src="images/sub_product_02.gif"/></a></td>
</tr>
</tbody></table></td>
</tr>
<tr>
<td><table width="823" cellspacing="0" cellpadding="0" border="0">
<tbody><tr>
<td valign="top"><table width="823" cellspacing="0" cellpadding="0" border="0">
<tbody><tr>
<td width="30" valign="top"><img width="1" height="1" src="images/1blank.gif"/></td>
<td valign="top" height="40"><img width="168" height="19" src="images/sub_menu03_01_title.gif"/></td>
</tr>
<tr>
<td valign="top"><img width="1" height="1" src="images/1blank.gif"/></td>
<td valign="top"><table width="100%" cellspacing="0" cellpadding="0" border="0" class="font">
<tbody><tr>
<td valign="top" height="50"><table cellspacing="0" cellpadding="0" border="0" class="font">
<tbody><tr>
<td><img width="543" height="1" src="images/sub_company_01_01_line.gif"/></td>
</tr>
<tr>
<td><table width="100%" cellspacing="0" cellpadding="0" border="0" class="font">
<tbody><tr>
<td width="40" height="30"><img width="11" height="8" alt="" src="images/sub_company_01_01_img01.gif"/></td>
<form name="search" method="GET">
<td><select id="select" class="font" name="type">
{set.searchType}
</select>
<input type="text" maxlength="30" size="30" class="font" name="keyword" value="{set.searchKeyword}" onClick="javascript:this.value='';"/>
<input type="hidden" name="status" value="{set.status}"/>
<input type="submit" value="검색">
</td></form>
</tr>
</tbody></table></td>
</tr>
<tr>
<td><img width="543" height="1" src="images/sub_company_01_01_line.gif"/></td>
</tr>
<tr> </tr>
</tbody></table></td>
</tr>
<tr>
<td valign="top" height="80"><table width="100%" cellspacing="0" cellpadding="0" border="0" class="font">
<tbody><tr>
<td><table width="780" cellspacing="0" cellpadding="3" bordercolor="#cccccc" border="2" style="border-collapse: collapse;" class="font">
<tbody><tr>
<td bgcolor="<!--{? set.status == '1' }-->#FFFF99<!--{:}-->#f2f2f2<!--{/}-->">
<div align="center">입금대기</div></td>
<td bgcolor="<!--{? set.status == '2' }-->#FFFF99<!--{:}-->#f2f2f2<!--{/}-->">
<div align="center">입금완료</div></td>
<td bgcolor="<!--{? set.status == '3' }-->#FFFF99<!--{:}-->#f2f2f2<!--{/}-->">
<div align="center">신청취소</div></td>
<td bgcolor="#f2f2f2"><div align="center">총계</div></td>
</tr>
<tr>
<td bgcolor="<!--{? set.status == '1' }-->#FFFF99<!--{:}-->#f2f2f2<!--{/}-->">
<a href="./courseOrders.php?{set.makelink}status=1"><span id="readynum">{set.readynum}</span></a>
</td>
<td bgcolor="<!--{? set.status == '2' }-->#FFFF99<!--{:}-->#f2f2f2<!--{/}-->">
<a href="./courseOrders.php?{set.makelink}status=2"><span id="completenum">{set.completenum}</span></a></td>
<td bgcolor="<!--{? set.status == '3' }-->#FFFF99<!--{:}-->#f2f2f2<!--{/}-->">
<a href="./courseOrders.php?{set.makelink}status=3"><span id="canclenum">{set.canclenum}</span></a></td>
<td bgcolor="#f2f2f2"><a href="./courseOrders.php?{set.makelink}"><span id="totalnum">{set.totalnum}</span></a></td>
</tr>
</tbody></table></td>
</tr>
<tr>
<td height="20">*숫자를 클릭하면 리스트가 나타납니다.</td>
</tr>
</tbody></table></td>
</tr>
<tr>
<td><table width="780" cellspacing="0" cellpadding="3" bordercolor="#cccccc" border="2" style="border-collapse: collapse;" class="font">
<tbody><tr>
<td><div align="center">순번</div></td>
<td><div align="center">학생 이름</div></td>
<td><div align="center">연락처 1</div></td>
<td><div align="center">핸드폰</div></td>
<td><div align="center">강의명</div></td>
<td><div align="center">선생님</div></td>
<td><div align="center">은행/금액/입금주</div></td>
<td><div align="center">상태</div></td>
<td><div align="center">메모</div></td>
</tr>
<!--{? set.nodata }-->
<tr><td colspan=8>검색된 데이터가 없습니다.</td></tr>
<!--{/}-->
<!--{@ data}--> 
<tr datano="{data.no}">
<td>{data.no}</td>
<td>{data.student_name}</td>
<td>{data.tel1}</td>
<td>{data.tel2}</td>
<td>{data.course_name}</td>
<td>{data.teacher_name}</td>
<td>{data.bank}/{data.price}/{data.bankname}</td>
<td>
<select class="font" name="type" onChange="javascript:chgValue(this)" typevalue="{data.status}">
{data.selectbox}
</select>
</td>
<td>
<input type="text" size="15" name="memo" value="{data.memo}" onChange="javascript:chgValue(this)" />
</td>
</tr>
<!--{/}--> 
</tbody></table></td>
</tr>
<tr>
<td height="40">
{set.paging}
</td>
</tr>
</tbody></table></td>
</tr>
</tbody></table></td>
</tr>
</tbody></table></td>
</tr>
</tbody></table>
